package com.basic.technology.study.test;

import com.basic.technology.study.testtest.Test1;

import java.util.HashMap;
import java.util.Map;

public class Vizi extends Test1{
    public static void main(String[] args) {
        String mailService = "USPS Retail Ground&lt;sup&gt;&#174;&lt;/sup&gt;";
        System.out.println(getServiceName(mailService));
        System.out.println(sum(100));

        Map<String, String> uspsMapping = getUSPSMapping();
        for (Map.Entry<String, String>  entry : uspsMapping.entrySet()) {
            System.out.println(entry.getValue());
        }

    }

    public static String getServiceName(String mailService) {
        return mailService.replaceAll("&lt;sup&gt;&#8482;&lt;/sup&gt;", "")
                .replaceAll("&lt;", "")
                .replaceAll("/sup&gt;", "")
                .replaceAll("&#8482;", "")
                .replaceAll("sup&gt;", "")
                .replaceAll("&#174;", "");
    }

    public static int sum(int i) {
        if (i <= 1){
            return i;
        }
        return i+ sum(i-1);
    }

    public static Map<String, String> getUSPSMapping() {
        Map<String, String> mapping = new HashMap();
        mapping.put("Priority Mail Medium Flat Rate Box", "USPS Priority Mail");
        mapping.put("Priority Mail Express 1-Day", "USPS Priority Mail Express");
        mapping.put("USPS Retail Ground", "USPS First-Class Mail");
        mapping.put("Priority Mail 1-Day", "USPS Priority Mail 1-Day");
        mapping.put("Priority Mail 2-Day", "USPS Priority Mail 2-Day");
        mapping.put("Priority Mail 2-Day Medium Flat Rate Box", "USPS Priority Mail 2-Day Medium Flat Rate Box");
        mapping.put("Priority Mail 2-Day Flat Rate Envelope", "USPS Priority Mail 2-Day Flat Rate Envelope");
        mapping.put("Priority Mail 2-Day Small Flat Rate Envelope", "USPS Priority Mail 2-Day Small Flat Rate Envelope");
        mapping.put("Priority Mail 2-Day Small Flat Rate Box", "USPS Priority Mail 2-Day Small Flat Rate Box");
        mapping.put("Priority Mail Express 2-Day", "USPS Priority Mail Express 2-Day");
        mapping.put("Priority Mail Express 3-Day", "USPS Priority Mail Express 3-Day");
        mapping.put("THREE_DAY_SELECT", "UPS THREE DAY SELECT");
        mapping.put("UPS_NEXT_DAY_AIR_EARLY", "UPS NEXT DAY AIR EARLY");
        mapping.put("GROUND", "UPS GROUND");
        mapping.put("NEXT_DAY_AIR_SAVER", "UPS NEXT DAY AIR SAVER");
        mapping.put("NEXT_DAY_AIR", "UPS NEXT DAY AIR");
        mapping.put("Second_DAY_AIR", "UPS Second DAY AIR");
        return mapping;
    }

    /**
     *
     * USPS Retail Ground&lt;sup&gt;&#174;&lt;/sup&gt;
     *
     * USPSTransitTime.put("Priority Mail 1-Day", Lists.newArrayList(new Integer[]{1}));
     *         USPSTransitTime.put("Priority Mail 2-Day", Lists.newArrayList(new Integer[]{2}));
     *         USPSTransitTime.put("Priority Mail 2-Day Medium Flat Rate Box", Lists.newArrayList(new Integer[]{2}));
     *         USPSTransitTime.put("Priority Mail 2-Day Flat Rate Envelope", Lists.newArrayList(new Integer[]{2}));
     *         USPSTransitTime.put("Priority Mail 2-Day Small Flat Rate Envelope", Lists.newArrayList(new Integer[]{2}));
     *         USPSTransitTime.put("Priority Mail 2-Day Small Flat Rate Box", Lists.newArrayList(new Integer[]{2}));
     *         USPSTransitTime.put("Priority Mail Express 1-Day", Lists.newArrayList(new Integer[]{1}));
     *         USPSTransitTime.put("Priority Mail Express 2-Day", Lists.newArrayList(new Integer[]{2}));
     *         USPSTransitTime.put("Priority Mail Express 3-Day", Lists.newArrayList(new Integer[]{3}));
     *         USPSTransitTime.put("USPS Retail Ground", Lists.newArrayList(new Integer[]{5}));
     *         USPSTransitTime.put("Priority Mail Medium Flat Rate Box", Lists.newArrayList(new Integer[]{3}));
     */
}
